from rest_framework import serializers
from users.models import User


# 1. 定义模型序列化器
class UserSerializer(serializers.ModelSerializer):
    class Meta:
        model = User
        fields = ('id', 'username', 'mobile', 'email', 'email_active')
        # fields = '__all__'  # 所有字段
        # exclude = ['password']  # 排除 id 字段
